package com.divemotor.ventarepuestosinternet.util;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ManagedBean(name = "ordenarDatatable")
@ViewScoped
public class OrdernarDatatable implements Serializable {

	private static final long serialVersionUID = 1L;

	public int ordernar(Object object1, Object object2) {
		String stringObject1 = ((String)object1).toLowerCase();
		String stringObject2 = ((String)object2).toLowerCase();
		if (stringObject1.compareTo(stringObject2) < 0) {
			return -1;
		} else if (stringObject1.compareTo(stringObject2) > 0) {
			return 1;
		} else {
			return 0;
		}
	}
}
